#include <stdio.h>
#include <signal.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>

void handler(int signo)
{
  printf("catch a signal:%d\n", signo);
  printf("signal:SIGINT\n");
}

int main()
{
  struct sigaction act;
  memset(&act, 0, sizeof(act));

  sigemptyset(&act.sa_mask);
  act.sa_handler = handler;
  act.sa_flags = 0;
  sigaction(SIGINT, &act, NULL);

  while(1){
    printf("I am a process!\n");
    sleep(1);
  }
  return 0;
}
